package com.gvsoft.conns;

import java.nio.channels.SocketChannel;

/**
 * Created with IntelliJ IDEA.
 * ProjectName:gvMsgRouting
 * Author: zhaoqiubo
 * Date: 15/8/5
 * Time: 上午8:34
 * Desc: 连接类，保存通道及通道最后访问时间。
 */
public class GVConnection {

    private String token;
    private String userId;
    private SocketChannel channel;
    private int lastAccessTime;

    public GVConnection(String token,String userId, SocketChannel channel, int lastAccessTime) {

        this.token = token;
        this.userId = userId;
        this.channel = channel;
        this.lastAccessTime = lastAccessTime;

    }

    public void setLastAccessTime(int lastAccessTime){
        this.lastAccessTime = lastAccessTime;
    }

    public SocketChannel getChannel() {
        return channel;
    }

    public String getToken() {
        return token;
    }

    public String getUserId(){
        return userId;
    }

    public int getLastAccessTime() {
        return lastAccessTime;
    }
}
